import os
import numpy as np
import cv2

if not os.path.exists('./lists_BraTs'):
    os.mkdir('./lists_BraTs')
file_list = os.listdir('/home/s003/文档/dataset/BraTs/trainImage')
with open('./lists_BraTs/train.txt', mode='w') as file:
    for i in file_list:
        file.write(i[:-4])
        file.write('\n')

file_list = os.listdir('/home/s003/文档/dataset/BraTs/testImage')
with open('./lists_BraTs/test.txt', mode='w') as file:
    for i in file_list:
        file.write(i[:-4])
        file.write('\n')
print('OK!')
